home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
COMAL
/
B-Book Series
/
(k)b2.d64
/
test141
< prev
next >
Wrap
Text File
|
2007-02-28
|
798b
|
36 lines
0030 DIM COLOUR$(4) OF 10, NAME$(13) OF 10
0040 DIM CARD$ OF 20, HAND$(6) OF 20
0050 DIM DRAWN$ OF 300
0060 //
0070 COLOUR$(1):="DIAMONDS"
0080 COLOUR$(2):="CLUBS"
0090 COLOUR$(3):="SPADES"
0100 COLOUR$(4):="HEARTS"
0110 //
0120 FOR I:=1 TO 13 DO
0130 READ NAME$(I)
0140 ENDFOR I
0150 DATA "ACE","TWO","THREE","FOUR"
0160 DATA "FIVE","SIX","SEVEN","EIGHT"
0170 DATA "NINE","TEN","JACK","QUEEN","KING"
0180 //
0190 FOR DRAW:=1 TO 6 DO
0200 FINDCARD
0210 HAND$(DRAW):=CARD$
0220 ENDFOR DRAW
0230 DISPLAY
0240 //
0250 PROC FINDCARD
0260 REPEAT
0270 CARD$:=NAME$(RND(1,13))
0280 CARD$:=CARD$+" OF "+COLOUR$(RND(1,4))
0290 UNTIL NOT CARD$ IN DRAWN$
0300 DRAWN$:=DRAWN$+CARD$
0310 ENDPROC FINDCARD
0320 //
0330 PROC DISPLAY
0340 FOR I:=1 TO 6 DO
0350 PRINT HAND$(I)
0360 ENDFOR I
0370 ENDPROC DISPLAY